<?php
include '../Module/OrderModule.php';
$OrdModule=new OrderModule();
if(isset($_REQUEST["action"])){
    switch ($_REQUEST["action"]){
        case"add":
            $_type		=isset($_REQUEST["_type"])?$_REQUEST["_type"]:"";
            $name		=isset($_REQUEST["name"])?EndcodeStr($_REQUEST["name"]):"";
            $mail		=isset($_REQUEST["mail"])?EndcodeStr($_REQUEST["mail"]):"";
            $phone		=isset($_REQUEST["phone"])?EndcodeStr($_REQUEST["phone"]):"";
            $address		=isset($_REQUEST["address"])?EndcodeStr($_REQUEST["address"]):"";
            $content		=isset($_REQUEST["content"])?EndcodeStr($_REQUEST["content"]):"";
            $payment		=isset($_REQUEST["payment"])?EndcodeStr($_REQUEST["payment"]):"";
            
            if($OrdModule->insertOrder($payment,$name,$mail,$phone,$address,$content,$_type)){
                echo "true";
            }else{
                echo "Error: Please, Check level of carts.<br/>".$OrdModule->error;
            }
            break;
        
    }    
}
?>